﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="inc/set.asp"-->
<!--#include file="inc/conn.asp"-->
<%
'-----------------------------------------------------------------
	dim keyword
	keyword=trim(request("key"))
	'response.Write(request("key")+"add")
			'接收ajax发送的参数
	if keyword="" then response.End()
'------------------------------------------------------------------
   ' dim dbdriver,dbpath,conn,rs,sql
  '  dbdriver="microsoft.jet.oledb.4.0"
'    dbpath=server.mappath("search.mdb")
'    set conn=server.CreateObject("adodb.connection")
'    conn.provider=dbdriver
'    conn.open dbpath

	set rs=server.CreateObject("adodb.recordset")
	sql="select * from Hotel where h_name like '%"&keyword&"%' order by id desc"
	rs.open sql,conn,1,1
'------------------------------------------------------------------
	'--------如果没有找到的话,返回0
	'--------如果找到的话,返回所有匹配的项目
	if not (rs.eof and rs.bof) then
response.ContentType= "application/xml"
Response.Expires = 0 		
response.Write("<results>")
		for i=0 to 9
			if rs.eof then exit for
			h_name   =   Replace(rs("h_name"),"&","&amp;")  
			response.Write("<result    key="""&h_name&""" h_zone="""&rs("h_zone")&""" ></result>")
			rs.movenext
		next
		response.Write("</results>")
	end if
	rs.close
	set rs=nothing
%>
